package cn.tedu.front.job.schedule;


import cn.tedu.front.job.service.IPositionService;
import cn.tedu.front.job.service.impl.PositionServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//预热项目启动后 ,将职位添加到redis中
// 週期執行
@Slf4j
@Component
public class ScheduleStart {

    @Autowired
    private IPositionService positionServiceImpl;

    @Scheduled(cron = "0 30 2 * * ?") // 每日凌晨2:30执行
    public void rebuildSearch() {
        log.debug("开始执行重建职业搜索数据");
        positionServiceImpl.rebuildSearch();
    }

}
